﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Presentation.Module.Scheduling.Interfaces.Services;
using Presentation.Module.Scheduling.Interfaces;
using Application.Interfaces;

namespace Presentation.Module.Scheduling.Services
{
    

    public class ScheduleStudysService : IScheduleStudyService
    {
        public ScheduleStudysService(ISchedulingManagementService schedulingManagementService)
        {
            this.SchedulingManagementService = schedulingManagementService;

            this.ScheduleStudyMapper = new VPL.Mapper.Mapper<ViewDto.ScheduleStudy, Domain.Scheduling.Entities.ScheduleStudy>();
        }

        public ISchedulingManagementService SchedulingManagementService { get; set; }

        public VPL.Mapper.Mapper<ViewDto.ScheduleStudy, Domain.Scheduling.Entities.ScheduleStudy> ScheduleStudyMapper { get; set; }

        public List<ViewDto.ScheduleStudy> GetAllScheduleStudys()
        {
            return ScheduleStudyMapper.Map(SchedulingManagementService.GetAllScheduleStudys()).ToList();
        }

        public void EditScheduleStudy(ViewDto.ScheduleStudy schedulestudy)
        {
            SchedulingManagementService.UpdateScheduleStudy(ScheduleStudyMapper.Map(schedulestudy));
        }

        public void RemoveScheduleStudy(ViewDto.ScheduleStudy schedulestudy)
        {
            SchedulingManagementService.DeleteScheduleStudy(ScheduleStudyMapper.Map(schedulestudy));
        }

        public ViewDto.ScheduleStudy AddScheduleStudy(ViewDto.ScheduleStudy schedulestudy)
        {
            return
                ScheduleStudyMapper.Map(SchedulingManagementService.AddScheduleStudy(ScheduleStudyMapper.Map(schedulestudy))); ;
        }
    }

}
